//getBreakerAllActionDatas();
function getBreakerAllActionDatas() {
	$.getJSON('/rest/waveData/getBreakerAllActionDatas', function(result) {
		initActList(result);
		var link = "breakerWave.xhtml?fileId="
			+ result[0][1] + "&breakerId="
			+ result[0][3] + "&phase=" + result[0][4] + "&actTime="
			+ result[0][5] + "&removeTime="+ result[0][8] ;
	    var name=result[0][0]+result[0][2]+"跳"+result[0][4]+"("+result[0][6]+")";
		getProtectActTime(link,name,result[0][1],result[0][4]);
	});
}
/*function initActList(data) {
	var ul = $('<ul></ul>');
	ul.appendTo($("#actList .box-body"));
	for ( var i in data) {
		var li = $('<li></li>').appendTo(ul);
		var link = "breakerWave.xhtml?fileId="
			+ data[i][1] + "&breakerId="
			+ data[i][3] + "&phase=" + data[i][4] + "&actTime="
			+ data[i][5] + "&removeTime="+ data[i][8];
	    var name=data[i][0]+data[i][2]+"跳"+data[i][4]+"("+data[i][6]+")";
		var a = $("<a href='javascript:void(0)' onclick=\"getProtectActTime('"+link+"','"+name+"','"+data[i][1]+"','"+data[i][4]+"')\"></a>").html(
				data[i][0] + data[i][2] + "跳" + data[i][4]+" "+data[i][7]).css({
			"font-size" : "16px",
			"cursor" : "pointer"
		}).appendTo(li);
		var index = 0;
		$("#actList .box-body").on("click", "li", function() {
			$($("#actList li")[index]).removeClass();
			$(this).addClass("selected");
			index = $(this).index();
		});
	}
	$($("#actList li")[0]).addClass("selected");
}*/
function initWaveView(){
	
	var link = "breakerWave.xhtml?fileId="
		+ result[0][1] + "&breakerId="
		+ result[0][3] + "&phase=" + result[0][4] + "&actTime="
		+ result[0][5] + "&removeTime="+ result[0][8] ;
	var name=result[0][0]+result[0][2]+"跳"+result[0][4]+"("+result[0][6]+")";
	getProtectActTime(link,name,result[0][1],result[0][4]);
}
function getProtectActTime(link,name,fileId,phase){
	$('#sel').html(name);
	//点击左侧列表，根据fileId和phase，获取最早的保护动作时间
	$.getJSON('/rest/waveData/getMinProtectActTime/'+fileId+"/"+phase, function(result) {
		link=link+"&protectAct="+result;
		$('#wavePage').attr('src',link);
	})
}